/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.controller;

/**
 *
 * @author rmeloni
 */

import com.dao.Onibus;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class OnibusController {

    //protected final Log logger = LogFactory.getLog(getClass());

    @RequestMapping("/onibus")
    public ModelAndView showonibus() {

        //logger.info("Returning hello view");
        
        List<Onibus> listaOnibus = new ArrayList<Onibus>();
        listaOnibus.add(new Onibus("538"));
        listaOnibus.add(new Onibus("539"));
        listaOnibus.add(new Onibus("2014"));
  
        ModelAndView modelAndView = new ModelAndView("onibus");
        modelAndView.addObject("onibusList", listaOnibus);
  
        return modelAndView;
    }

}
